<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ page import="dto.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'findbyid.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <style type="text/css">
    table{position:absolute;left:400px;top:150px;}
    .input{width:180px}
    </style>
  </head>
  
  <body background="img/4561.jpg">
    <form name="form1" action="doUpdateServlet" method="post">
      <table align="center" border="3" bordercolor="pink">
        <tr>
          <td align="center" colspan="2">
            <font color="purple" size="5">学生信息</font>
          </td>
        </tr>
        <tr>
          <td align="center">
                                 学生姓名
          </td>
           <td align="center">
             <input type="hidden" name="stuId" value="${student.stuId}"/>
             <input type="text"  class="input" name="stuName" value="${student.stuName}">
          </td>
        </tr>
        <tr>
          <td align="center">
                                 学生性别
          </td>
           <td align="center">
                                    男<input type="radio" name="stuSex" value="男" <c:if test="${student.stuSex=='男'}">checked</c:if> >
                                    女<input type="radio" name="stuSex" value="女" <c:if test="${student.stuSex=='女'}">checked</c:if> >
          </td>
        </tr>
        <tr>
           <td align="center">
             <font color="purple">出生年月</font>
           </td>
           <td>
            <input type="hidden" name="y" value="${year }"/>
            <input type="hidden" name="m" value="${month }"/>
            <input type="hidden" name="d" value="${day }"/>
            <select id="year" name="year" onchange="getDays();">
             <option selected value="">-${year }-</option>
             <option value="1985">1985</option>
             <option value="1986">1986</option>
             <option value="1987">1987</option>
             <option value="1988">1988</option>
             <option value="1989">1989</option>
             <option value="1990">1990</option>
             <option value="1991">1991</option>
             <option value="1992">1992</option>
             <option value="1993">1993</option>
             <option value="1994">1994</option>
             <option value="1995">1995</option>
            </select>
            <select id="month" name="month" onchange="getDays();">
             <option selected value="">-${month }-</option>
             <option value="01">01</option>
             <option value="02">02</option>
             <option value="03">03</option>
             <option value="04">04</option>
             <option value="05">05</option>
             <option value="06">06</option>
             <option value="07">07</option>
             <option value="08">08</option>
             <option value="09">09</option>
             <option value="10">10</option>
             <option value="11">11</option>
             <option value="12">12</option>
            </select>
            <select id="day" name="day">
             <option selected value="">-${day }-</option>
            </select>
          </td>
         </tr>
        <tr>
          <td align="center" colspan="2">
             <input type="submit" name="sb" value="提交">
             <input type="button" name="but" value="返回" onclick="window.location='doShowList'">
          </td>
        </tr>
      </table>
    </form>
  </body>
  <script type="text/javascript">
  function $(id){
	  return document.getElementById(id);
  }
  function getDays(){
	  var month=$("month");
	  var n=$("year").value;
	  var m=$("month").value;
	  var day=$("day");
	  var total=31;
	  if(""!=n&&""!=m){
		  if(m==2){
			  if(n%4==0&&n%100!=0){
				  total=29;
			  }else{
				  if(n%4==0&&n%100==0&&n%400==0){
					 total=29; 
				  }else{
					  total=28;
				  }
			  }
		  }else{
			  if(m==04||m==06||m==09||m==11){
				  total=30;
			  }
		  }
		  for(var i=1;i<=total;i++){
			  var op=new Option(i);
			  op.value=i;
			  day.add(op);
		  }
	  }
  }
  </script>
</html>
